<?php
require_once('PHPUnit/Autoload.php');

//function getDocumentRoot()
//{
//    $returnPath = "";
//    if(false !== strpos($_SERVER['DOCUMENT_ROOT'], 'PEAR') ) {
//        $returnPath = $_SERVER['DOCUMENT_ROOT'];
//    } else {
//        $returnPath = 'D:/Programme/Xampp/htdocs/Game/';
//    }
//    return $returnPath;
//}

//function __autoload($class) {
////    echo "<br>autoload with $class";
//
//    if (!file_exists(getDocumentRoot() . $class . ".php")) {//false === require_once($class . ".php")) {
//        if (!file_exists(getDocumentRoot() . "includes/" . $class . ".php")) {//false === require_once(getDocumentRoot() . "includes/" . $class . ".php")) {
//        } else {
//            require_once(getDocumentRoot() . "includes/" . $class . ".php");
//        }
//    } else {
//        require_once($class . ".php");
//    }
//
//    if (!class_exists($class)) {//true === strchr($class, "_")) {
//        error_log("\n bingo bongo \n");
//        $class = str_replace("_","/", $class);
//        error_log("\n in here" . getDocumentRoot() . $class . "\n");
//        if (!file_exists(getDocumentRoot() . $class . ".php")) {//false === require_once($class . ".php")) {
//            if (!file_exists(getDocumentRoot() . "includes/" . $class . ".php")) {//false === require_once(getDocumentRoot() . "includes/" . $class . ".php")) {
//                die('no file has been found arround');
//            } else {
//                require_once(getDocumentRoot() . "includes/" . $class . ".php");
//            }
//        } else {
//            require_once($class . ".php");
//        }
//    }
//}

//spl_autoload_register('__autoload');